<script type="text/javascript">
	$(document).ready(function(e){
		
		$('#ISSave').click(function(){
		
			$.ajax({
				type: "POST",
				url: "<?php echo base_url();?>index.php/can_register/can_update",
				data: {
					id: $('#id').val(),
					first_name: $('#firstname').val(),
					last_name: $('#lastname').val(),
					nick_name: $('#nick_name').val(),
					email: $('#email').val(),
				},
				success: function(data)
				{
					if(data=='Yes'){
						alert("Data is not updated!");
						
					}else if(data=='No'){
						alert("Data has been updated!");
					}
				}
			
			});
			
		});
	
	});
</script>

<?php $this->load->helper('dob_helper'); ?>
<div class="paper">
	<div class="post_title">Account Information</div>
	<table width="100%" border="0" cellpadding="0" cellspacing="" class="hr_tbl border_r">
		<?php foreach($single_emp as $employer): ?>
		<tbody>		
		<tr style="height: 25px; ">
			<input type="hidden" id="id" value="<?php echo $employer->Id;?>"/>
			<td class=" cut_string" style="padding: 5px; border-bottom: 1px dotted #EEE; ">First Name</td>
			<td class=" cut_string" style="padding: 5px; border-bottom: 1px dotted #EEE; "><input type="text" id="firstname" class="txtfirstname cut_string" value="<?php echo $employer->first_name;?>"></td>
		</tr>
		<tr style="height: 25px; ">
			<td class=" cut_string" style="padding: 5px; border-bottom: 1px dotted #EEE; ">Last Name</td>
			<td class=" cut_string" style="padding: 5px; border-bottom: 1px dotted #EEE; "><input type="text" id="lastname" class="txtlastname cut_string" value="<?php echo $employer->last_name;?>"></td>
		</tr>
		<tr style="height: 25px; ">
			<td class=" cut_string" style="padding: 5px; border-bottom: 1px dotted #EEE; ">Email</td>
			<td class=" cut_string" style="padding: 5px; border-bottom: 1px dotted #EEE; "><input type="text" id="email" class="txtemail cut_string" value="<?php echo $employer->email;?>"></td>
		</tr>
		<tr style="height: 25px; ">
			<td class=" cut_string" style="padding: 5px; border-bottom: 1px dotted #EEE; ">BusinessName</td>
			<td class=" cut_string" style="padding: 5px; border-bottom: 1px dotted #EEE; "><input type="text" id="nick_name" class="txtnickname cut_string" value="<?php echo $employer->business_name;?>"></td>
		</tr>
		<tr style="height: 25px; ">
			<td class=" cut_string" style="padding: 5px; border-bottom: 1px dotted #EEE; ">Username</td>
			<td class=" cut_string" style="padding: 5px; border-bottom: 1px dotted #EEE; "><?php echo $employer->user_name;?></td>
		</tr>
		<tr style="height: 25px; ">
			<td class=" cut_string" style="padding: 5px; border-bottom: 1px dotted #EEE; ">Member Since</td>
			<td class=" cut_string" style="padding: 5px; border-bottom: 1px dotted #EEE; "><?php echo format_date($employer->date_created);?></td>
		</tr>
		<tr style="height: 25px; ">
			<td colspan="2" style="padding: 5px; border-bottom: 1px dotted #EEE; ">
				<input type="button" value="Change Password" class="btnChangePassword btnform">
				<!--<input type="button" value="Cancel" class="btnCancelPassword" >-->
			</td>
		</tr>
		<!--<tr>
			<td colspan="2">
				<div class="pw_ch_h">
					<div class="pw_ch_block">Current password: <input type="password" name="opassword" class="opassword" placeholder="Current Password"></div>
					<div class="pw_ch_block">New password: <input type="password" name="rpassword" class="rpassword" placeholder="New Password"></div>
					<div class="pw_ch_block">Comfirm password: <input type="password" name="crpassword" class="crpassword" placeholder="Re-Password"></div>
					<div style="float:right;position:relative;display:block;">
						<input type="button" value="Reset" class="btnChangePassword btnform">
						<input type="button" value="Cancel" class="btnCancelPassword btnform">
					</div>
					<input type="hidden" class="username" name="username" value="ornthim">
					<div class="pw_ch_block reset_msg" style="color: #149741;"></div>
				</div>
			</td>
		</tr>-->
		<tr>
			<td colspan="2" align="center"><input type="button" id="ISSave" class="saveaccount btnform" value="Save"></td>
		</tr>
		<tr style="height: 25px">
			<td colspan="2" class="msg_h" style="color: #149741; text-align: center;"></td>
		</tr>
	</tbody>
	<?php endforeach; ?>
	</table>
	
</div>